/**
 * Carnegie Mellon University
 * School of Computer Science
 * MSIT eBusiness Technology
 * 
 * Team 8 - Infinity (2011 Spring)
 * infinity-team8@googlegroups.com
 * 
 * Professor: Jeffrey L. Eppinger
 * Program Faculty: Sujata Telang
 */

package databean;

import java.sql.Date;
import java.text.DecimalFormat;
import java.text.NumberFormat;


public class TransactionBean implements Comparable<TransactionBean> {

	private long transactionID = 0;
	private long customerID = 0;
	private long fundID = 0;
	private Date executeDate = null;
	private long shares = 0;
	private long sharePrice = 0;
	private String transactionType = null;
	private long amount = 0;

	public TransactionBean(long transactionID) {
		this.transactionID = transactionID;
	}

	@Override
	public int compareTo(TransactionBean o) {
		// TODO Auto-generated method stub
		return 0;
	}

	public long getCustomerID() {
		return customerID;
	}

	public void setCustomerID(long customerID) {
		this.customerID = customerID;
	}

	public long getFundID() {
		return fundID;
	}

	public void setFundID(long fundID) {
		this.fundID = fundID;
	}

	public Date getExecuteDate() {
		return executeDate;
	}

	public void setExecuteDate(Date executeDate) {
		this.executeDate = executeDate;
	}

	public long getShares() {
		return shares;
	}

	public void setShares(long shares) {
		this.shares = shares;
	}

	public String getTransactionType() {
		return transactionType;
	}

	public void setTransactionType(String transactionType) {
		this.transactionType = transactionType;
	}

	public long getAmount() {
		return amount;
	}

	public void setAmount(long amount) {
		this.amount = amount;
	}

	public long getTransactionID() {
		return transactionID;
	}

	public long getSharePrice() {
		return sharePrice;
	}

	public void setSharePrice(long sharePrice) {
		this.sharePrice = sharePrice;
	}

	public String getFormatedShare() {
		String rs = "";
		NumberFormat formatter = new DecimalFormat("##0.000");
		rs = formatter.format((double) this.shares / 1000);
		return rs;
	}

	public String getFormatedSharedPrice() {
		NumberFormat formatter = new DecimalFormat("##0.00");
		String s = formatter.format((double) sharePrice / 100);
		return s;
	}

	public String getAmountFormatted(){
		
		NumberFormat formatter = new DecimalFormat("##0.00");
		String s = formatter.format((double) amount / 100);

		return s;
	}

}
